#include "uart.h"
#include "led.h"
#include "clock.h"

int main(void)
{
	int c;
	clock_init();	
	led_init();
	uart_init();

	led_write(0, LED_ON);
	led_write(1, LED_ON);
	led_write(2, LED_ON);
	led_write(3, LED_ON);

	puts("UART Test in S5PV210");
	puts("1.LED1 Toggle");
	puts("2.LED2 Toggle");
	puts("Please select 1 or 2 to Toggle the LED");
	
	while (1)
	{
		c = getchar();			// 从串口终端获取一个字符
		putchar(c);				// 回显
		putchar('\r');

		if (c == '1') led_toggle(1);			// 改变LED1的状态
		else if (c == '2') led_toggle(2);		// 改变LED1的状态
	}
	return 0;
}
